import {defineStore, storeToRefs} from 'pinia'

export const useOrderStore = defineStore('orderInfo', {
    state: () => ({
        petsInfo: [],
		addressInfo: {},
        getKeyInfo: {
            keyMethodsId: null,
            content: "",
        },
        returnKeyInfo: {
            keyMethodsId: null,
            content: "",
        },
        serviceDemandList: [],
        serviceDateList: [],
        selectedExtraServiceListByStore: [],
		petTeacherInfo:{},
    }),
    persist: {
        storage: {
            getItem: (key : string) => uni.getStorageSync(key),
            setItem: (key : string, value : string) => uni.setStorageSync(key, value)
        }
    }

})

export const useOrderStoreToRefs = () => {
    return storeToRefs(useOrderStore())
}
export const resetUseOrderStore = () => {
	useOrderStore().$reset()
}